<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>驾驶证档案详情审核</title>
<link rel="stylesheet" type="text/css" href="${ctx}/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${ctx}/easyui/easyui_my.css">
<link rel="stylesheet" type="text/css" href="${ctx}/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="${ctx}/css/css.css" />

<script type="text/javascript" src="${ctx}/js/jquery-1.7.min.js"></script>
<script type="text/javascript" src="${ctx}/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${ctx}/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${ctx}/js/common.js"></script>
</head>
<script type="text/javascript"> 
var jsonstr="[]";  
var jsonarray = eval('('+jsonstr+')'); 
$(function(){
	var TypeListArea = "";
	//循环列表,加载第一个档案类型所有图片
	<c:forEach items="${listTpurl}" var="obj" varStatus="status">
    var htmlPicArea = "";
    var url="${obj.singleIpaddress}";
	if("${obj.id}"=='1'){
	//var picmc=url.substring(url.lastIndexOf("/")+1);
	var Ocxid="playOcx"+${status.index};
	htmlPicArea +="<object id=\""+Ocxid+"\" classid=\"clsid:BCB28301-A827-4DE4-BA67-623FAC960893\" width=\"100%\" height=\"99%\"></object>";
	$("#TableDatatp2").append(htmlPicArea);
	document.getElementById(Ocxid).ImageUrl = "${obj.singleIpaddress}";
	document.getElementById(Ocxid).WaterImage();
	//htmlPicArea += "<img src=\""+url+"\" width=\"70%\" height=\"50%\"/>";
	}
</c:forEach>
	//TypeListArea += "<div onClick=\"a_click(fileNameType1)\"><a href=\"#"+i+"\" style=\"background: #eb6014\" id=\"${status.index+1}\">身份证明</a></div>";			

	//var array = new Array();
	//转json数组
	//var jsonArray="{}";
	            
	<c:forEach items="${listTpurl}" var="t">  
		//array.push("${t.id}","${t.singleIpaddress}"); 
	    var formdata = {  
	            "id" : "fileNameType"+"${t.id}",  
	            "singleIpaddress" : "${t.singleIpaddress}"
	        };
	    jsonarray.push(formdata); 
	</c:forEach>  
     
    // TypeListArea += "<div style=\"margin-bottom:50px\"></div>";
	//$("#TableDatatp1").html(TypeListArea);
	//$("#TableDatatp2").html(htmlPicArea);
	//location.hash="#${picmc}";
	
});
function a_click(o){
	debugger;
	$(".anniuyanshid li").removeClass("hoveraddclass");
	$("#"+o).addClass("hoveraddclass");
	showPic(o);
}

//根据文件类型id显示相应的档案图片
function showPic(id){
	$("#TableDatatp2").empty();
	for(var i=0;i<jsonarray.length;i++){	
		if(jsonarray[i].id==id){
			var Ocxid="playOcx"+i;
			htmlPicArea=""
			htmlPicArea +="<object id=\""+Ocxid+"\" classid=\"clsid:BCB28301-A827-4DE4-BA67-623FAC960893\" width=\"100%\" height=\"99%\"></object>";
			$("#TableDatatp2").append(htmlPicArea);
			//Ocxid.BindImage(url, 1);
			document.getElementById(Ocxid).ImageUrl = jsonarray[i].singleIpaddress;
			document.getElementById(Ocxid).WaterImage();
		   // document.Ocxid.WaterImage();
			/* tbody="";
			tbody += "<div><img src=\""+jsonarray[i].singleIpaddress+"\" width=\"70%\" height=\"50%\"/></div>";
			$("#TableDatatp2").append(tbody); */
		}
	}
}
</script>
<body class="easyui-layout">
	<div data-options="region:'east',border:false" id="TableDatatp1" style="width:300px; background:#f0f0f0;border-left: 1px solid #d2d2d2;">
	<div style="margin: 10px 0 0 0;">
	<table cellspacing="0" cellpadding="0" border="0" width="100%" class="dananguanglikuang">	     
		     	 <tr>
		             <th align="right" height="28">姓名：</th>
		             <td>
		                 <input type="text" id="xm" name="xm"  value="${info.xm }" readonly="readonly">
		             </td>
		         </tr>
		         <tr>
		             <th align="right" height="28">性别：</th>
		             <td>
		                 <input type="text" id="xbmc" name="xbmc"  value="${info.xbmc }" readonly="readonly"/>
		             </td>
		         </tr>
		         <tr>
		             <th align="right" height="28">发证机关：</th>
		             <td>
		                 <input type="text" id="fzjg" name="hpzl" value="${info.fzjg }" readonly="readonly"/>
		             </td>
		             </tr>
		     	 <tr>
		             <th align="right" height="28">档案编号：</th>
		             <td>
		                 <input type="text" id="dabh" name="dabh"  value="${info.dabh }" readonly="readonly"/>
		             </td>
		         </tr>
		         <tr>
		              <th align="right" height="28">身份证明号码：</th>
		             <td>
		                 <input type="text" id="sfzmhm" name="sfzmhm" value="${info.sfzmhm }" readonly="readonly"/>
		             </td>
		         </tr>
		         
		         <tr>
		           <th align="right" height="28"><font color="#FF0000">审核：</font></th>
	                <td>
	                <input  id="yxshztSelect" name="yxshztSelect" class="easyui-combobox " 
						data-options="
						prompt:'请选择审核批复',
						valueField:'value',
						textField:'text',
						panelHeight:'auto',
						editable:false,
						data:[
						{value:'2',text:'审核通过'},
						{value:'3',text:'审核不通过'}]"/>
	                </td>
				  </tr>
		    </table>
		    <div style="height: 60px;">
				    <input type="hidden" id="currentXh" value="${info.xh}"/>
					<input type="hidden" id="startTime" value="${startTime}"/>
					<input type="hidden" id="endTime" value="${endTime}"/>
					<!-- 上一个机动车序号 -->
					<input type="hidden" id="preXh" value="${preXh}"/>
					<!-- 下一个机动车序号 -->
					<input type="hidden" id="nextXh" value="${nextXh}"/>
					<!-- 当前页数所有的机动车序号 -->
					<input type="hidden" id="xhs" value="${xhs }"/>
					<!-- 总页数 -->
					<input type="hidden" id="totalPage" value="${pageInfo.totalPage}"/>
					<!-- 当前页数 -->
					<input type="hidden" id="currentPage" value="${pageInfo.currentPage}"/>
					<!-- 每一页大小 -->
					<input type="hidden" id="pageSize" value="${pageInfo.pageSize}"/>
					<!--当前数据在xhs中的位置-->
					<input type="hidden" id="currentIndex" value="${pageInfo.currentIndex}"/>
               <div class="diyipaidhusnfhenfnf1" style="margin:2px;">
					    <c:choose>
	                        <c:when test="${nextXh ne '0'}"> 
	                         <a href="#" style=" float: right; margin: 0 27px 0 0 ;" class="congzhim" onClick="javascript :pageJump('${nextXh }','pageDown');" style="visibility: visible;">下一条</a>
	                        </c:when>
	                        <c:otherwise>
	                            <a href="#" style=" float: right; margin: 0 27px 0 0 ;" class="congzhim">下一条</a>
	                        </c:otherwise>   
	                    </c:choose>
	                    <c:choose>
	                        <c:when test="${preXh ne '0'}"> 
	                            <a href="#" class="congzhim" style=" float: right; margin: 0 8px 0 0 ;" onClick="javascript :pageJump('${preXh}','pageUp');" style="visibility: visible;">上一条</a>
	                        </c:when>
	                        <c:otherwise>
	                            <a href="#" style=" float: right; margin: 0 8px 0 0 ;" class="congzhim1">上一条</a>
	                        </c:otherwise> 
                       </c:choose>
                       <a id="saveId" href="#" style=" float: right; margin: 0 9px 0 0 ;" class="congzhim" onClick="javascript:VerifyAndSave();" style="visibility: visible;">确认审核</a>
	          </div> 
         </div>
		    </div>		
		    
		    
	<div class="anniujiheti">	    
		<ul class="anniuyanshid">
			<li onClick="a_click(this.id)" id="fileNameType1" class="hoveraddclass"><a href="#fileNameType11" id="fileNameType11">身份证明</a></li>	
			<li onClick="a_click(this.id)" id="fileNameType2"><a href="#fileNameType21" id="fileNameType21">申请表</a></li>	
			<li onClick="a_click(this.id)" id="fileNameType3"><a href="#fileNameType31" id="fileNameType31">交强险</a></li>	
			<li onClick="a_click(this.id)" id="fileNameType4"><a href="#fileNameType41" id="fileNameType41">纳税证明</a></li>
			<li onClick="a_click(this.id)" id="fileNameType5"><a href="#fileNameType51" id="fileNameType51">来历证明</a></li>
			<li onClick="a_click(this.id)" id="fileNameType6"><a href="#fileNameType61" id="fileNameType61">采集合格证</a></li>	
			<li onClick="a_click(this.id)" id="fileNameType7"><a href="#fileNameType71" id="fileNameType71">查验记录表</a></li>
		</ul>
		<dl class="fangdasuoxiaodan">
			<dd><a href="###">放大</a></dd>
			<dd><a href="###">缩小</a></dd>
		</dl>		
	</div>      
	</div>
	<div data-options="region:'center',border:false" id="TableDatatp2">
	
	</div>


</body>

<script type="text/javascript">
//审核操作
function VerifyAndSave(){
		var yxshzt=$("#yxshztSelect").combobox('getValue');
		var xh=$("#currentXh").val();
		if(yxshzt==""){
			alert("请选择审核批复");
			return;
		}
		if(confirm("确定审核此驾驶证档案？")){
		$.ajax({
		type:'POST',
		url:'${ctx}/yxxx/updateDriverYxshzt.htm',
		data:{xh:xh,
			  dazt:yxshzt},
		dataType:'json',
		success:function(data,textStatus,jqXHR){
			if(data==true){
				alert("审核成功");
				  $("#saveId").removeClass("congzhim").addClass("congzhim1");
				  $("#saveId").removeAttr("onclick");
				//pageJump('${nextXh }','pageDown');
				//$('#yxshztSelect').combobox('clear');
			}else{
				alert("审核失败");
			}
		}
		});
	  }
	}
//查询信息
function pageJump(_xh,upOrDown){
	var currentPage=$('#currentPage').val();//获取当前页数
    var totalPage=$('#totalPage').val();//总页数
    var index=$('#currentIndex').val();//当前数据在当前分页页面中的位置
    var pageSize=$('#pageSize').val();//每一页展示的个数
	var currentXh=$('#currentXh').val();//当前机动车序号
    var xhs=$('#xhs').val();//当前分页所有的xh,已都好形式分隔开
    var xhArr=[];
    if(null!=xhs && undefined!=xhs){
        xhArr=xhs.split(',');
    }
    if(upOrDown=='pageUp'){
        if(index==0){
            index=Number(pageSize)-1;
            _xh='0,'+_xh+','+currentXh;
            currentPage=Number(currentPage)-1;//减一页
        }else{
            _xh=getPreOrNextXh(_xh,xhArr,upOrDown)+','+_xh+','+currentXh;
        }
    }else if(upOrDown=='pageDown'){
        //下一页
        if(index==Number(pageSize)-1){
            index=0;
            _xh=currentXh+','+_xh+',0';
            currentPage=Number(currentPage)+1;//加一页
        }else{
            index=Number(index)+1;
            _xh=currentXh+','+_xh+','+getPreOrNextXh(_xh,xhArr,upOrDown);
        }
    }
    var startTime=$('#startTime').val();//开始时间
    var endTime=$('#endTime').val();//结束时间
    var param={
    	xh:_xh,
    	xhs:xhs,
    	currentPage:currentPage,
    	pageSize:pageSize,
    	totalPage:totalPage,
    	currentIndex:index,
    	startTime:startTime,
    	endTime:endTime
    };
    parent.addTab("驾驶证档案审核详情","${ctx}/yxxx/findDriverYxshFirstIn.htm?xh="+_xh+"&xhs="+xhs+
      "&currentPage="+currentPage+"&totalPage="+totalPage+
      "&pageSize="+pageSize+"&currentIndex="+index+"&startTime="+startTime+"&endTime="+endTime);
}

</script>